﻿#pragma  once

#include "datatable.h"
#include "TableReader.h"
#include "cocos2d.h"
#include "TSingleton.h"

USING_NS_CC;

//配置文件单例
//需要在init()方法中初始化
class TableMgr : public TSingleton<TableMgr>
{
public:

	TableMgr();
	virtual ~TableMgr();

	virtual void init();
	
public:

	CC_SYNTHESIZE_READONLY(GameEffectTable*, _gameffectable, EffectTable);
	CC_SYNTHESIZE_READONLY(GameMusicTable*, _gamemusictable, MusicTable);
	CC_SYNTHESIZE_READONLY(FishModelTable*, _fishModelTable, FishTable);
	CC_SYNTHESIZE_READONLY(BulletModelTable*, _bulletModelTable,BulletTable);
	CC_SYNTHESIZE_READONLY(CannonModelTable*, _cannonModelTable, CannonTable);
	CC_SYNTHESIZE_READONLY(NetModelTable*, _netModelTable, FishNetTable);

};

#define  GET_MusicTable TableMgr::getInstance()->getMusicTable()                   //音乐表
#define  GET_EffectTable TableMgr::getInstance()->getEffectTable()                 //音效表
#define  GET_FishTable TableMgr::getInstance()->getFishTable()                     //鱼表
#define  GET_BulletTable TableMgr::getInstance()->getBulletTable()					//子弹表
#define  GET_CannonTable TableMgr::getInstance()->getCannonTable()					//炮台表
#define  GET_FishNetTable TableMgr::getInstance()->getFishNetTable()                //渔网表